package com.scholarship.modules.student.mapper;

import com.scholarship.modules.student.dto.*;
import com.scholarship.modules.student.dto.applicationDto.ApplicationBaseInfoDto;
import com.scholarship.modules.student.dto.applicationDto.ForeignExamDto;
import com.scholarship.modules.student.entity.Student;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author: huanghao
 * @date: 2021/3/2 16:47
 * @description: 学生Mapper
 * @modifiedBy:
 */

@Repository
public interface StudentMapper {
    //获取所有学生信息--测试
    List<Student> getAllStudent();

    //根据用户id获取学生信息
    Student getStudentByUserId(String id);

    //获取学生密码
    String getStudentPasswordById(String userId);

    //获取学生专业信息
    MajorInfoDto getStudentMajorInfo(String userId);

    //获取学生邮箱
    String getStudentEmail(String userId);

    //根据邮箱来查询userIdList
    List<String> getUserIdByEmail(String email);

    //更新学生密码
    //mybatis update操作返回值是受影响行数
    int updateStudentPassword(StudentPasswordDto studentPassword);

    //更新学生基本信息
    int updateStudentBaseInfo(Student student);

    //获取申请表基本信息
    ApplicationBaseInfoDto getApplicationBaseInfo(String userId);

    //获取四级成绩
    int getCET4ById(String userId);

    //获取六级成绩
    int getCET6ById(String userId);

    //插入四级成绩
    int insertCET4(ForeignExamDto foreignExamDto);

    //插入六级成绩
    int insertCET6(ForeignExamDto foreignExamDto);

    //更新四级成绩
    int updateCET4(ForeignExamDto foreignExamDto);

    //更新六级成绩
    int updateCET6(ForeignExamDto foreignExamDto);
}
